<html>
<head><meta charset="utf-8"><title>Remove Metadata (line, column, file) · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Remove.20Metadata.20(line.2C.20column.2C.20file).html">Remove Metadata (line, column, file)</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="220793744"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Remove%20Metadata%20%28line%2C%20column%2C%20file%29/near/220793744" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> not-matthias <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Remove.20Metadata.20(line.2C.20column.2C.20file).html#220793744">(Dec 23 2020 at 14:37)</a>:</h4>
<p>I have this project that patches <code>rustc-driver</code>so that the <code>line!</code>, <code>column!</code>, <code>file!</code> and the caller location intrinsic do not return any information. The project works, but patching the binary is difficult because the binary and signatures can always change. </p>
<p>So I was wondering if it would be possible to somehow implement this directly in the compiler?</p>



<a name="220797372"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Remove%20Metadata%20%28line%2C%20column%2C%20file%29/near/220797372" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Remove.20Metadata.20(line.2C.20column.2C.20file).html#220797372">(Dec 23 2020 at 15:16)</a>:</h4>
<p>You can compile rustc from scratch.</p>



<a name="220797598"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Remove%20Metadata%20%28line%2C%20column%2C%20file%29/near/220797598" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> not-matthias <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Remove.20Metadata.20(line.2C.20column.2C.20file).html#220797598">(Dec 23 2020 at 15:19)</a>:</h4>
<p>I know, but it's quite annoying to do that everytime a new a version has been released. I want to make this project also available for others so having to manage all the different versions and give them out, is definitely not going to be easy.</p>



<a name="220797860"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Remove%20Metadata%20%28line%2C%20column%2C%20file%29/near/220797860" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Remove.20Metadata.20(line.2C.20column.2C.20file).html#220797860">(Dec 23 2020 at 15:23)</a>:</h4>
<p>It seems plausible that we might be able to add a -Z flag which does this, but I would personally be mildly opposed - it seems likely that it may break some crates, especially with regards to file!() returning nothing. I would be interested in knowing what you intend to achieve with this patch</p>



<a name="220801674"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Remove%20Metadata%20%28line%2C%20column%2C%20file%29/near/220801674" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> not-matthias <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Remove.20Metadata.20(line.2C.20column.2C.20file).html#220801674">(Dec 23 2020 at 16:08)</a>:</h4>
<p>Well, the idea behind this is to get rid of all the metadata in the panic messages. I think I messed something up and thought that the <code>line!</code>, <code>column!</code> and <code>file!</code> macros are responsible for the metadata in the panic messages. <br>
We could instead return placeholder values for the <code>caller_location</code> intrinsic (see: <a href="https://github.com/rust-lang/rust/blob/master/library/core/src/panic.rs#L231">https://github.com/rust-lang/rust/blob/master/library/core/src/panic.rs#L231</a>). I have not seen any crate that has ever used it. This way we can still have the functionality of the macros but get rid of the panic metadata. Another improvement would be the removing of the panic message. Not sure if that's possible.</p>



<a name="220802191"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Remove%20Metadata%20%28line%2C%20column%2C%20file%29/near/220802191" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Remove.20Metadata.20(line.2C.20column.2C.20file).html#220802191">(Dec 23 2020 at 16:14)</a>:</h4>
<p>you can override <code>panic_hook</code> I'm pretty sure</p>



<a name="220802199"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Remove%20Metadata%20%28line%2C%20column%2C%20file%29/near/220802199" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Remove.20Metadata.20(line.2C.20column.2C.20file).html#220802199">(Dec 23 2020 at 16:14)</a>:</h4>
<p><a href="https://doc.rust-lang.org/std/panic/fn.set_hook.html">https://doc.rust-lang.org/std/panic/fn.set_hook.html</a></p>



<a name="220802255"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Remove%20Metadata%20%28line%2C%20column%2C%20file%29/near/220802255" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Remove.20Metadata.20(line.2C.20column.2C.20file).html#220802255">(Dec 23 2020 at 16:15)</a>:</h4>
<p>the example in those comments gives this output:</p>
<div class="codehilite"><pre><span></span><code>Custom panic hook
</code></pre></div>
<p>without any line info</p>



<a name="220802382"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Remove%20Metadata%20%28line%2C%20column%2C%20file%29/near/220802382" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Remove.20Metadata.20(line.2C.20column.2C.20file).html#220802382">(Dec 23 2020 at 16:16)</a>:</h4>
<p>then you don't need any changes to the compiler</p>



<a name="220802462"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Remove%20Metadata%20%28line%2C%20column%2C%20file%29/near/220802462" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> not-matthias <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Remove.20Metadata.20(line.2C.20column.2C.20file).html#220802462">(Dec 23 2020 at 16:17)</a>:</h4>
<p>I don't think this will remove the panic metadata in the binary but I'll try it out and report the results. <br>
EDIT: Just tried it and the metadata still exists in the binary as expected.</p>



<a name="220802825"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Remove%20Metadata%20%28line%2C%20column%2C%20file%29/near/220802825" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Remove.20Metadata.20(line.2C.20column.2C.20file).html#220802825">(Dec 23 2020 at 16:21)</a>:</h4>
<p>It would be helpful to know <em>why</em> you want to remove that metadata</p>



<a name="220803328"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Remove%20Metadata%20%28line%2C%20column%2C%20file%29/near/220803328" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Remove.20Metadata.20(line.2C.20column.2C.20file).html#220803328">(Dec 23 2020 at 16:26)</a>:</h4>
<p><span class="user-mention silent" data-user-id="356998">not-matthias</span> <a href="#narrow/stream/131828-t-compiler/topic/Remove.20Metadata.20(line.2C.20column.2C.20file)/near/220802462">said</a>:</p>
<blockquote>
<p>I don't think this will remove the panic metadata in the binary but I'll try it out and report the results. <br>
EDIT: Just tried it and the metadata still exists in the binary as expected.</p>
</blockquote>
<p>did you remember to remove the debug info?</p>



<a name="220803338"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Remove%20Metadata%20%28line%2C%20column%2C%20file%29/near/220803338" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Remove.20Metadata.20(line.2C.20column.2C.20file).html#220803338">(Dec 23 2020 at 16:26)</a>:</h4>
<p>err actually not sure if that's on by default - it is with cargo, but not sure about rustc itself</p>



<a name="220803359"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Remove%20Metadata%20%28line%2C%20column%2C%20file%29/near/220803359" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Remove.20Metadata.20(line.2C.20column.2C.20file).html#220803359">(Dec 23 2020 at 16:26)</a>:</h4>
<p>panic metadata isn't debuginfo, and can't be (easily) removed after the fact</p>



<a name="220803662"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Remove%20Metadata%20%28line%2C%20column%2C%20file%29/near/220803662" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> not-matthias <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Remove.20Metadata.20(line.2C.20column.2C.20file).html#220803662">(Dec 23 2020 at 16:30)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116122">simulacrum</span> <a href="#narrow/stream/131828-t-compiler/topic/Remove.20Metadata.20(line.2C.20column.2C.20file)/near/220802825">said</a>:</p>
<blockquote>
<p>It would be helpful to know <em>why</em> you want to remove that metadata</p>
</blockquote>
<p>There's multiple reasons to remove the metadata: </p>
<ul>
<li>Privacy (leaking paths)</li>
<li>Reverse Engineering (very easy once you have the file name)</li>
<li>Size (path strings take quite a lot of space in large projects)</li>
</ul>
<p>I know that there's the <code>--remap-path-prefix</code> argument, but that isn't really a solution and didn't work for me.</p>



<a name="220803737"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Remove%20Metadata%20%28line%2C%20column%2C%20file%29/near/220803737" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Remove.20Metadata.20(line.2C.20column.2C.20file).html#220803737">(Dec 23 2020 at 16:31)</a>:</h4>
<p>Can you say more - it seems like that should solve the privacy part of this</p>



<a name="220803917"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Remove%20Metadata%20%28line%2C%20column%2C%20file%29/near/220803917" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> not-matthias <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Remove.20Metadata.20(line.2C.20column.2C.20file).html#220803917">(Dec 23 2020 at 16:32)</a>:</h4>
<p>I tried it a while ago and I don't remember what exactly the error was. I just know that it didn't remove the path prefixes. My primary goal was to prevent reverse engineering so I moved on researching other solutions.</p>



<a name="220803921"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Remove%20Metadata%20%28line%2C%20column%2C%20file%29/near/220803921" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Remove.20Metadata.20(line.2C.20column.2C.20file).html#220803921">(Dec 23 2020 at 16:32)</a>:</h4>
<p>I am not sure about reverse engineering - file names don't seem that beneficial to me personally, and aren't limited to just panic metadata (e.g. <code>file!()</code> also introduces them).</p>
<p>In any case I am not sure the compiler can not emit the panic metadata - it is basically entirely library code I think that does so?</p>



<a name="220804001"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Remove%20Metadata%20%28line%2C%20column%2C%20file%29/near/220804001" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Remove.20Metadata.20(line.2C.20column.2C.20file).html#220804001">(Dec 23 2020 at 16:33)</a>:</h4>
<p>If there are bugs in the remapping of paths, then we would be happy to see issues or PRs fixing that.</p>



<a name="220804063"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Remove%20Metadata%20%28line%2C%20column%2C%20file%29/near/220804063" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Remove.20Metadata.20(line.2C.20column.2C.20file).html#220804063">(Dec 23 2020 at 16:34)</a>:</h4>
<p>Features going beyond that I think would likely need more explanation for me to say what the best way to propose them would be</p>



<a name="220804444"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Remove%20Metadata%20%28line%2C%20column%2C%20file%29/near/220804444" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> not-matthias <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Remove.20Metadata.20(line.2C.20column.2C.20file).html#220804444">(Dec 23 2020 at 16:38)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116122">simulacrum</span> <a href="#narrow/stream/131828-t-compiler/topic/Remove.20Metadata.20(line.2C.20column.2C.20file)/near/220803921">said</a>:</p>
<blockquote>
<p>I am not sure about reverse engineering - file names don't seem that beneficial to me personally, and aren't limited to just panic metadata (e.g. <code>file!()</code> also introduces them).</p>
</blockquote>
<p>As an example: You want to reverse engineer a binary and patch the login or some networking stuff. The first thing you'll usually do is show all the strings and search for network related keyword. When someone finds the filename (e.g. <code>network.rs</code>), they can spend all their time on that. I know that removing the metadata is not going to solve this in any way, but it would make it much harder. </p>
<p>I'll try to check again if <code>remap-path-prefix</code> works.</p>



<a name="220804626"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Remove%20Metadata%20%28line%2C%20column%2C%20file%29/near/220804626" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Remove.20Metadata.20(line.2C.20column.2C.20file).html#220804626">(Dec 23 2020 at 16:40)</a>:</h4>
<p>I guess that's true. Can you say more about how other compilers provide ways to avoid this? (if they do)</p>



<a name="220805435"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Remove%20Metadata%20%28line%2C%20column%2C%20file%29/near/220805435" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Remove.20Metadata.20(line.2C.20column.2C.20file).html#220805435">(Dec 23 2020 at 16:50)</a>:</h4>
<p>For <code>#[no_std]</code> I think you can use a custom <code>#[panic_handler]</code> and the linker will drop the messages</p>



<a name="220805512"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Remove%20Metadata%20%28line%2C%20column%2C%20file%29/near/220805512" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Remove.20Metadata.20(line.2C.20column.2C.20file).html#220805512">(Dec 23 2020 at 16:50)</a>:</h4>
<p>But that's hardly ideal</p>



<a name="220806048"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Remove%20Metadata%20%28line%2C%20column%2C%20file%29/near/220806048" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Remove.20Metadata.20(line.2C.20column.2C.20file).html#220806048">(Dec 23 2020 at 16:57)</a>:</h4>
<p>CC <a href="https://github.com/rust-lang/rust/issues/59222">https://github.com/rust-lang/rust/issues/59222</a></p>



<a name="220814590"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Remove%20Metadata%20%28line%2C%20column%2C%20file%29/near/220814590" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> not-matthias <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Remove.20Metadata.20(line.2C.20column.2C.20file).html#220814590">(Dec 23 2020 at 18:28)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116122">simulacrum</span> <a href="#narrow/stream/131828-t-compiler/topic/Remove.20Metadata.20(line.2C.20column.2C.20file)/near/220804626">said</a>:</p>
<blockquote>
<p>I guess that's true. Can you say more about how other compilers provide ways to avoid this? (if they do)</p>
</blockquote>
<p>I don't know of any other language where the standard library prints this kind of information. The closest thing are exceptions in C++ but there is no metadata. You can set a message, but the compiler will obviously not remove it.</p>



<a name="220815749"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Remove%20Metadata%20%28line%2C%20column%2C%20file%29/near/220815749" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Remove.20Metadata.20(line.2C.20column.2C.20file).html#220815749">(Dec 23 2020 at 18:40)</a>:</h4>
<p>Javascript does. In addition in almost every compiled language, symbol names are exposed allowing a debugger to show the full backtrace. Symbol names should be enough for reverse engineering.</p>



<a name="220815789"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Remove%20Metadata%20%28line%2C%20column%2C%20file%29/near/220815789" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Remove.20Metadata.20(line.2C.20column.2C.20file).html#220815789">(Dec 23 2020 at 18:41)</a>:</h4>
<p>But symbol names are easy to strip, unlike panic messages and locations.</p>



<a name="220815832"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Remove%20Metadata%20%28line%2C%20column%2C%20file%29/near/220815832" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Remove.20Metadata.20(line.2C.20column.2C.20file).html#220815832">(Dec 23 2020 at 18:41)</a>:</h4>
<p>As for leaking paths, that is one of the use cases of <code>--remap-path-prefix</code>. The other is reproducibility of builds.</p>



<a name="220882935"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Remove%20Metadata%20%28line%2C%20column%2C%20file%29/near/220882935" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Remove.20Metadata.20(line.2C.20column.2C.20file).html#220882935">(Dec 24 2020 at 17:57)</a>:</h4>
<p>It would be nice if we could remap path prefixes to be relative to the project route by default.</p>



<a name="220884213"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Remove%20Metadata%20%28line%2C%20column%2C%20file%29/near/220884213" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Remove.20Metadata.20(line.2C.20column.2C.20file).html#220884213">(Dec 24 2020 at 18:24)</a>:</h4>
<p>That would break debugging. Or at least for dependencies. There would be no way to distinguish <code>lib.rs</code> of dep1 and dep2.</p>



<a name="220884304"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Remove%20Metadata%20%28line%2C%20column%2C%20file%29/near/220884304" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Remove.20Metadata.20(line.2C.20column.2C.20file).html#220884304">(Dec 24 2020 at 18:25)</a>:</h4>
<p>It would be more realistic if cargo remapped the crate root to something describing the exact crate. (name, version, git repo/registry, ...)</p>



<a name="220884307"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Remove%20Metadata%20%28line%2C%20column%2C%20file%29/near/220884307" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Remove.20Metadata.20(line.2C.20column.2C.20file).html#220884307">(Dec 24 2020 at 18:25)</a>:</h4>
<p>That would still need debugger support though.</p>



<a name="221172551"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Remove%20Metadata%20%28line%2C%20column%2C%20file%29/near/221172551" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Remove.20Metadata.20(line.2C.20column.2C.20file).html#221172551">(Dec 29 2020 at 22:16)</a>:</h4>
<p>s/route/root/ obviously; sigh, autocorrect.</p>



<a name="221172598"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Remove%20Metadata%20%28line%2C%20column%2C%20file%29/near/221172598" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Remove.20Metadata.20(line.2C.20column.2C.20file).html#221172598">(Dec 29 2020 at 22:17)</a>:</h4>
<p>And yes, remapping based on crate name and version would be appealing, if tools could handle that.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>